#include "addhabit.h"
#include "ui_addhabit.h"
#include "QMessageBox"
#include "ui_mainwindow.h"

AddHabit::AddHabit(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AddHabit)
{
    ui->setupUi(this);
}

AddHabit::~AddHabit()
{
    delete ui;
}

void AddHabit::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void AddHabit::on_btnCancel_clicked()
{

}

void AddHabit::on_btnAdd_clicked()
{
    QString content = ui->plainTextEdit->toPlainText();
    if(content.isNull()||content.size()==0)
    {
        QMessageBox::information(this,"Warning","Habit CANNOT Be Empty!");
    }
    else
    {
        // add habit and changet to habit detail widget
    // qApp->exit();

    }

}
